﻿using System.IO;
using System.Reflection;
using System.Windows;

namespace Theodorus
{
	/// <summary>
	///
	/// Interaction logic for App.xaml
	/// </summary>
	public partial class App
	{
		protected override void OnStartup(StartupEventArgs e)
		{
			Theodorus.Properties.Settings.Default.Upgrade();
            var dir = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
			if (dir != null)
			{
				var dirinfo = new DirectoryInfo(dir);
				var files = dirinfo.GetFiles("*Plugin.dll",SearchOption.TopDirectoryOnly);
				foreach(var fileinfo in files)
				{
					Assembly.LoadFile(fileinfo.FullName);
				}
			}
		}
	}
}
